package com.CusterRelSys.service.impl;

import com.CusterRelSys.entity.CstCustomer;
import com.CusterRelSys.mapper.CstSustomerMapperMWJ;
import com.CusterRelSys.service.ICstSustomerServiceMWJ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by MWJ on 2017/12/1.
 */
@Service
public class CstSustomerServiceImplMWJ implements ICstSustomerServiceMWJ{

    @Autowired
    private CstSustomerMapperMWJ cstSustomerMapperMWJ;

    /**
     * 查询不重复的地区
     * @return
     */
    @Override
    public List<String> selectSingleCustRegion() {
        return cstSustomerMapperMWJ.selectSingleCustRegion();
    }

    /**
     * 查询不重复的客户等级
     * @return
     */
    @Override
    public List<String> selectSingleCustLevel() {
        return cstSustomerMapperMWJ.selectSingleCustLevel();
    }

    /**
     * 通过页面条件查询所有符合条件的客户信息
     * @return
     */
    @Override
    public List<CstCustomer> selectByCondition(CstCustomer cstSustomer) {
        return cstSustomerMapperMWJ.selectByCondition(cstSustomer);
    }
    /**
     * 通过客户编号查询当前客户的所有信息
     * @param custNo
     * @return
     */
    @Override
    public List<CstCustomer> selectByCustNo(String custNo) {
        return cstSustomerMapperMWJ.selectByCustNo(custNo);
    }

    @Override
    public List<String> selectSingleCustManageName() {
        return cstSustomerMapperMWJ.selectSingleCustManageName();
    }

    @Override
    public List<String> selectSingleCustSatisfy() {
        return cstSustomerMapperMWJ.selectSingleCustSatisfy();
    }

    @Override
    public List<String> selectSingleCustCredit() {
        return cstSustomerMapperMWJ.selectSingleCustCredit();
    }

    @Override
    public int updateCustomer(CstCustomer cstSustomer) {
        return cstSustomerMapperMWJ.updateCustomer(cstSustomer);
    }
}
